#if !defined(__DUMMY_CONIO_H)
#define __DUMMY_CONIO_H

#define _NOCURSOR      0
#define _SOLIDCURSOR   1
#define _NORMALCURSOR  2

struct text_info {
    unsigned char winleft;
    unsigned char wintop;
    unsigned char winright;
    unsigned char winbottom;
    unsigned char attribute;
    unsigned char normattr;
    unsigned char currmode;
    unsigned char screenheight;
    unsigned char screenwidth;
    unsigned char curx;
    unsigned char cury;
};

#if !defined(__COLORS)
#define __COLORS

enum COLORS {
    BLACK,          /* dark colors */
    BLUE,
    GREEN,
    CYAN,
    RED,
    MAGENTA,
    BROWN,
    LIGHTGRAY,
    DARKGRAY,       /* light colors */
    LIGHTBLUE,
    LIGHTGREEN,
    LIGHTCYAN,
    LIGHTRED,
    LIGHTMAGENTA,
    YELLOW,
    WHITE
};
#endif

#define BLINK       128 /* blink bit */

enum text_modes
{
    /* DOS-compatible modes */

    LASTMODE = -1,
    BW40     = 0,
    C40,
    BW80,
    C80,
    MONO     = 7,
    C4350    = 64,

    /* New Color modes */

    C40X14   = 8,
    C40X21,
    C40X28,
    C40X43,
    C40X50,
    C40X60,

    C80X14,
    C80X21,
    C80X28,
    C80X43,
    C80X50,
    C80X60,

    /* New Black & White modes */

    BW40X14,
    BW40X21,
    BW40X28,
    BW40X43,
    BW40X50,
    BW40X60,

    BW80X14,
    BW80X21,
    BW80X28,
    BW80X43,
    BW80X50,
    BW80X60,

    /* New Monochrome modes */

    MONO14,             /* Invalid VGA mode */
    MONO21,
    MONO28,
    MONO43,
    MONO50,
    MONO60,

    _ORIGMODE = 65      /* original mode at program startup */
};


#define PASS_MAX    8   /* max. no. of chars returned by getpass */


extern   int  _directvideo;

extern   int  _wscroll;

#ifdef __cplusplus
extern "C" {
#endif

void          clreol( void );
void          clrscr( void );
void          delline( void );
int           gettext( int __left, int __top,
                            int __right, int __bottom,
                            void *__destin);
void          gettextinfo (struct text_info *__r );
void          gotoxy( int __x, int __y );
void          highvideo( void );
void          insline( void );
void          lowvideo( void );
int           movetext( int __left, int __top,
                             int __right, int __bottom,
                             int __destleft, int __desttop );
void          normvideo( void );
int           puttext( int __left, int __top,
                            int __right, int __bottom,
                            void *__source );
void          textattr( int __newattr );
void          textbackground( int __newcolor );
void          textcolor( int __newcolor );
void          textmode( int __newmode );
void          window( int __left, int __top, int __right, int __bottom);

void          _setcursortype( int __cur_t );
char *        cgets( char *__str );
int           cprintf( const char *__format, ... );
int           cvprintf( const char *__format, void *__arglist );
int           cputs( const char *__str );
int           cscanf( const char *__format, ... );
int           cvscanf( const char *__format, void *__arglist );
int           getch( void );
int           getche( void );
char *        getpass( const char *__prompt );
int           kbhit( void );
int           putch( int __c );
int           ungetch( int __ch );
int           wherex( void );
int           wherey( void );

__inline int _getch( void ) { return getch(); } /* for MSC compatibility */

/*
  This function will remove from the console event queue, any key-up events
  that are pending. under Win95 key-up events will incorrectly be translated
  into real key presses by the OS ReadFile() API call, which scanf() uses.
  The WinNT version of ReadFile() correctly ignores them, of course. The
  problem can occur when getch() is called to get a key, then scanf() is
  called to obtain more input from stdin.  On Win95 the key-up event that is
  still left in the event queue will cause ReadFile() to think that the same
  key was pressed again.  Although, good programming practice dictates that
  one shouldn't use both getch() and scanf() near each other in the same
  program, the following function could help alleviate this key-up problem.
  cscanf() does NOT suffer from this problem since it gets its input via
  getch() and not ReadFile().  __flush_win95_keyup_events() should be called
  before scanf() is called. Keep in mind that you must allow sufficient time
  for the user to release the key so that the key-up event is inserted
  before flushing the key-up events.  Otherwise, the key-up event will occur
  after scanf() is blocked and waiting inside ReadFile().

  __flush_win95_keyup_events() returns the number of key-up events that it
  removed from the queue.

*/
int           __flush_win95_keyup_events (void);


#ifdef __cplusplus
}
#endif

#endif  /* __CONIO_H */
